<?php

class DefaultActions extends Actions {

  public function pageDefault(){
    if($this->param(0)){
        /*
        header("HTTP/1.0 404 Not Found");
        header("Status: 404 Not Found"); 
        echo("Error 404.  No se encontro el recurso solicitado.");
         */
        if(str_replace(Config::get('script_name', 'index.php')."/","", $_SERVER['REQUEST_URI']) != $_SERVER['REQUEST_URI']) {
          $this->redirect(str_replace(Config::get('script_name', 'index.php')."/","", $_SERVER['REQUEST_URI']));
        } else { $this->redirect(Config::get('base_url', '/') . "pais/seleccionar"); }
    } else {
        $this->redirect(Config::get('base_url', '/') . "pais/seleccionar");
    }
  }

  public function pagePortada(){
    //$this->user->forceLogin();

    $view = new View("portada");
    $view->layout('layout_sitio');

    $controller = Controller::getInstance();

    $view->data->mensaje = "Modulo:".$controller->module_name;
    $view->show();

  }
  
}
